package com.ehi.alliance.resource;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by portz on 7/6/2017.
 */

@RefreshScope
@RestController
@RequestMapping(value = "/actors", produces = "application/json")
public class Demo {
    @Value("${alliance.port:default}")
    private String msg;

    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    public String getActor(@PathVariable("id") String id) {
        return "Property from git alliance.port is " + msg + " id:" + id;
    }

    @RequestMapping(value = "/ex", method = RequestMethod.GET)
    public String ex() {
        throw new RuntimeException("ddd");
    }
}
